<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="content">
            <div align="center" >
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <div align="center" style="width: 80%">
                    <h:form styleClass="jsfcrud_list_form">
                        <p:panel header="Tipos de Recurso Cadastrados">
                            <h:outputText escape="false" value="#{bundle.ListTiporecursoEmpty}" rendered="#{tiporecursoController.items.rowCount == 0}"/>
                            <h:panelGroup rendered="#{tiporecursoController.items.rowCount > 0}">
                                <p:commandButton ajax="false" process="@this"  action="#{tiporecursoController.previous}" value="#{bundle.Previous}" rendered="#{tiporecursoController.pagination.hasPreviousPage}"/>&nbsp;
                                <h:outputText value="#{tiporecursoController.pagination.pageFirstItem + 1} a #{tiporecursoController.pagination.pageLastItem + 1} de #{tiporecursoController.pagination.itemsCount} registro(s)"/>&nbsp;
                                <p:commandButton ajax="false" process="@this"  action="#{tiporecursoController.next}" value="#{bundle.Next}" rendered="#{tiporecursoController.pagination.hasNextPage}"/>&nbsp;
                                <h:dataTable value="#{tiporecursoController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="#{bundle.ListTiporecursoTitle_descricao}"/>
                                        </f:facet>
                                        <h:outputText value="#{item.descricao}"/>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Opções"/>
                                        </f:facet>
                                        <p:commandButton ajax="false" process="@this"  action="#{tiporecursoController.prepareView}" icon="ui-icon-plusthick" />
                                        <h:outputText value=" "/>
                                        <p:commandButton ajax="false" process="@this"  action="#{tiporecursoController.prepareEdit}" icon="ui-icon-pencil" />
                                        <h:outputText value=" "/>
                                        <p:commandButton ajax="false" process="@this"  action="#{tiporecursoController.destroy}" icon="ui-icon-trash" />
                                    </h:column>
                                </h:dataTable>
                            </h:panelGroup>
                            <br />
                            <p:commandButton ajax="false" process="@this"  action="#{tiporecursoController.prepareCreate}" value="#{bundle.ListTiporecursoCreateLink}"/>
                            <br />
                            <br />
                            <h:link outcome="/index" value="#{bundle.ListTiporecursoIndexLink}"/>
                        </p:panel>
                    </h:form>
                </div>
            </div>
        </ui:define>
    </ui:composition>

</html>
